<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>mu-inheritance</title>
	<script type="text/javascript" src="js/mu.js" charset="utf-8"></script>

</head>

<body>
<script type="text/javascript" charset="utf-8">
    function Animal(){
        //private variable
		var pfname;
		
        //Constructor
		this.Animal=function(name){
			pfname = name;
		}
		
		//getters and setters
		this.getName=function(){return pfname;}
		this.setName=function(value){pfname=value;}

		this.sayHello=function(){
		return "Hello, my name is "+pfname;
		}
    }
		
	function Dog(){
		//multi inheritance
		$(this).Extends(Animal);
		
		//private variable
		var pfsexe;
		
		this.getSexe=function(){return pfsexe;}
		this.setSexe=function(value){pfsexe=value;}
		
		//Constructor
		this.Dog=function(name){
			//Call parent constructor
			this.Animal(name);
		}
	}


    var wolf = $(Dog).New();
    wolf.setName("Wolfy");
    wolf.setSexe("Male");
    var dick = $(Dog).New();
    dick.setName("Dikie");
    dick.setSexe("Female");
    console.log(dick.pfname);
    console.log(dick.sayHello()+' I am a '+dick.getSexe());

    console.log(wolf.sayHello()+' I am a '+wolf.getSexe());

 

</script>
</body>
</html>
